import config from '../config';

define(function (require, exports, module) {
    var angular = require('angular');
    var api_prefix = G_CONFIG["api_prefix"]; //api前缀
    var ui = require("@yunke/core/ui");
    var util = require('@yunke/core/util').default;
    require("@yunke/jquery_pagination");
    require('angular-ui');
    require("../../../../contract/pages/receivable/receivable-refund-ctrl");

    angular.module('Refund', ['ngUI', 'ContractReceivableRefund'])
        .controller('refundCtl', ['$scope', 'appservice', 'contractCommonService', function ($scope, appservice, contractCommonService) {
            appservice.name = '明源云客-待录入回款';

            contractCommonService.getAccountHkList('', function (data) {
                $scope.importPayments = data;
                $scope.isloading = false;
                $scope.$applyAsync();
            }, function () {
                $scope.isloading = false;
                $scope.$applyAsync();
            });
            $scope.search = function (key) {
                $scope.isloading = true;
                contractCommonService.getAccountHkList(key, function (data) {
                    $scope.importPayments = data;
                    $scope.isloading = false;
                    $scope.$applyAsync();
                }, function () {
                    $scope.isloading = false;
                    $scope.$applyAsync();
                });
            }
        }]);
});